/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bankingsystem;

import java.io.*;

/**
 *this class is used for create Staff objects.
 * @author Hasitha Aravinda
 *  
 */


public class Staff implements Serializable {

    protected String string;

    /**
     * Get the value of string
     *
     * @return the value of string
     */
    public String getString() {
        return string;
    }

    /**
     * Set the value of string
     *
     * @param string new value of string
     */
    public void setString(String string) {
        this.string = string;
    }

    // varibales for store details of the Staff member
    private String name;
    private String nic;
    private String employe_id;
    private String password;
    private String position;

   
    /*
     * constructor with parametors.
     */
    public Staff(String name, String nic, String employe_id, String password, String position) {
        this.name = name;
        this.nic = nic;
        this.employe_id = employe_id;
        this.password = password;
        this.position = position;
    }


    /*
     * getters and setters
     */
    public String getEmployeeID() {
        return this.employe_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNic() {
        return nic;
    }

    public void setNic(String nic) {
        this.nic = nic;
    }

    protected void setPassword(String password) {
        this.password = password;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    /**
     * method for to show Staff member's details
     */
    public void showDetails() {
        System.out.println("======= Worker Details ========");
        System.out.println("Employee name:" + this.name);
        System.out.println("Employee's ID:" + this.employe_id);
        System.out.println("Employee work as:" + this.position);
        System.out.println("Employee's NIC:" + this.nic);
        System.out.println("=============================================");


    }

    /**
     *method for to check user password is correct or not. if correct retrns true, if not returns false;
     */
    public boolean checkPassword(String pass) {
        if (pass.equals(this.password)) {// if password is correct
            return true;
        } else {// case password is incorrect
            return false;
        }


    }
}// end of class

